From: Carlhuda Date: Wed, 5 Mar 2014 00:06:39 +0000 (-0800) Subject: Initial README with some commands sketched out X-Git-Tag: archive/raspbian/0.35.0-2+rpi1~3^2^2^2^2^2^2^2~1153 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/success//%22http:/www.example.com/cgi/success/?a=commitdiff_plain;h=4de86d2eec82a92944245d0f269fe55907135de7;p=cargo.git Initial README with some commands sketched out --- diff --git a/README.md b/README.md index e69de29bb..4535f0aee 100644 --- a/README.md +++ b/README.md @@ -0,0 +1,73 @@ +## Porcelain + +### cargo-compile + +``` +$ cargo compile +``` + +This command assumes the following directory structure: + +``` +|Cargo.toml +|~src +| | {main,lib}.rs +|~target +| |~x86_64-apple-darwin +| | |~lib +| | | |~[symlinked dependencies] +| | | | [build artifacts] +| |~... +``` + +When running `cargo compile`, Cargo runs the following steps: + +* `cargo verify --manifest=[location of Cargo.toml]` +* ... TODO: dependency resolution and downloading ... +* `cargo prepare` +* `cargo rustc --out-dir=[from Cargo.toml]/[platform] -L [from Cargo.toml]/[platform]/lib ...` + +## Plumbing + +### cargo-verify + +``` +$ cargo verify --manifest=MANIFEST +``` + +Verifies that the manifest is in the location specified, in a valid +format, and contains all of the required sections. + +#### Success + +``` +{ "success": true } +``` + +#### Errors + +``` +{ + "invalid": < "not-found" | "invalid-format" >, + "missing-field": [ required-field... ], + "missing-source": bool, + "unwritable-target": bool +} +``` + +### cargo-rustc + +``` +$ cargo rustc --out-dir=LOCATION -L LIBDIR -- ...ARGS +``` + +### cargo-prepare + +Prepare the directories (including symlinking dependency libraries) to +be ready for the flags Cargo plans to pass into `rustc`. + +## NOTES and OPEN QUESTIONS + +* We need to support per-platform calls to `make` (et al) to build + native (mostly C) code. Should this be part of `prepare` or a + different step between `prepare` and `cargo-rustc`. diff --git a/commands/cargo-rustc/main.rs b/commands/cargo-rustc/main.rs index 29bdfab4d..15745a5d6 100644 --- a/commands/cargo-rustc/main.rs +++ b/commands/cargo-rustc/main.rs @@ -1,5 +1,7 @@ #[crate_id="cargo-rustc"]; +extern crate rustc; + use std::os::args; use std::io::process::Process; @@ -13,6 +15,8 @@ fn main() { let mut arguments = args(); arguments.shift(); + println!("host: {}", driver::host_triple()); + if arguments[0] != ~"--" { fail!("LOL"); } else {